From: James Bielman Date: Mon, 7 Jul 2014 21:52:24 +0000 (-0700) Subject: init-xenstore-domain: Add optional ramdisk argument. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4668 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=b764b0166b25b2d55732f329dacf56f370cf0572;p=xen.git init-xenstore-domain: Add optional ramdisk argument. - Added an optional argument to allow passing a ramdisk to the Xenstore domain built by init-xenstore-domain. - This is needed for Xenstore/MAC to pass initial security policy. Signed-off-by: James Bielman Acked-by: Ian Campbell --- diff --git a/tools/xenstore/init-xenstore-domain.c b/tools/xenstore/init-xenstore-domain.c index 56a3c726c5..0d12169ca4 100644 --- a/tools/xenstore/init-xenstore-domain.c +++ b/tools/xenstore/init-xenstore-domain.c @@ -13,7 +13,7 @@ static uint32_t domid = -1; -static int build(xc_interface *xch, char** argv) +static int build(xc_interface *xch, int argc, char** argv) { char cmdline[512]; uint32_t ssid; @@ -44,6 +44,12 @@ static int build(xc_interface *xch, char** argv) dom = xc_dom_allocate(xch, cmdline, NULL); rv = xc_dom_kernel_file(dom, argv[1]); if (rv) goto err; + + if (argc > 4) { + rv = xc_dom_ramdisk_file(dom, argv[4]); + if (rv) goto err; + } + rv = xc_dom_boot_xen_init(dom, xch, domid); if (rv) goto err; rv = xc_dom_parse_image(dom); @@ -81,15 +87,15 @@ int main(int argc, char** argv) char buf[16]; int rv, fd; - if (argc != 4) { - printf("Use: %s \n", argv[0]); + if (argc < 4 || argc > 5) { + printf("Use: %s []\n", argv[0]); return 2; } xch = xc_interface_open(NULL, NULL, 0); if (!xch) return 1; - rv = build(xch, argv); + rv = build(xch, argc, argv); xc_interface_close(xch);